#include <iostream>
#include "Stone.h"

using namespace std;

const int Stone::BLACK;
const int Stone::WHITE;

Stone::Stone(int color) :
		mColor(color), mImmutable(false), mPotentialImmutable(false) {
	mColor = color;
}

Stone::Stone(const Stone& stone) {
	mColor = stone.mColor;
	mImmutable = stone.mImmutable;
	mPotentialImmutable = stone.mPotentialImmutable;
}

Stone::~Stone() {
}

void Stone::turn() {
	mColor = (mColor == Stone::BLACK) ? Stone::WHITE : Stone::BLACK;
}

string Stone::toString() {
	if (mImmutable) {
		return mColor == BLACK ? "■" : "□";
	} else if (mPotentialImmutable) {
		return mColor == BLACK ? "◆" : "◇";
	} else {
		return toString(mColor);
	}
}

string Stone::toString(int color) {
	return color == Stone::BLACK ? "●" : "○";
}

int Stone::otherColor(int color) {
//	return color == BLACK ? WHITE : BLACK;
	return BLACK + WHITE  - color;
}

